<link rel="stylesheet" href="../css/body.css" type="text/css" />
<script type="text/javascript" src="../js/event.js"></script>

<script type="text/javascript">

Ext.onReady(function(){
	
	event.view_event('content_event','tbcontent_event');
	$('#delete_event').click(function(){
		var ids= common.getChecked('content_event');
		if(ids == ""){
			alert("Chọn nội dung cần xóa");
		}else{
			if(confirm("Bạn chắc chắn muốn xóa?")){
				Ext.Ajax.request({
					url:  'services/event.php',
					method: 'POST',
					params: {	act : 'delete_event',
								ids : ids},
					success: function ( result, request ) {	
						if (result.responseText == 1){
							alert("Xóa thành công");
							event.view_event('content_event','tbcontent_event');
						}
					},
					failure: function ( result, request ) {
						alert(result);
					}
				});
				//event.delete_event(ids,'content_event','tbcontent_event');
			}
		}
	});
});
</script>	
 <h2>EVENT PAGE</h2>
	
<div id="wrapper">
	<form id="form" method="POST" action="">
		<fieldset>
			<legend>Content&nbsp;Table</legend>
			<div id='tbcontent_event'></div>
		</fieldset>

			<div class="btn-submit">
				<input type="button" id="delete_event" name="delete_event" value="Delete"  />
			</div>
	</form>
</div>